package cays.student.service;

import cays.student.dao.CourseDao;
import cays.student.vo.Course;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 课程业务服务类
 *
 * @author Chai yansheng
 * @create 2019/8/30
 **/
@Service
public class CourseService {
    @Resource
    private CourseDao courseDao;

    public List<Course> getAllCourse() {
        return courseDao.getAllCourse();
    }

    public Course getCourseByCno(String cno) {
        return courseDao.getCourseByCno(cno);
    }

    @Transactional
    public int updateCourseByCno(Course course) {
        return courseDao.updateCourseByCno(course);
    }

    @Transactional
    public int insertCourse(Course course) {
        return courseDao.insertCourse(course);
    }

    @Transactional
    public int deleteCourseByCno(String cno) {
        return courseDao.deleteCourseByCno(cno);
    }

}
